<template>
  <div class="HIS">
    <div class="aop sm-aop" v-if="Token">
      <v-head></v-head>
    </div>
    <div class="bottom">
      <div
        v-if="Token"
        class="pucMenu menu"
        :class="Token ? 'active1' : 'active'"
      >
        <v-sidebar></v-sidebar>
      </div>
      <div
        :style="!Token ? 'left:0px' : 'left:200px'"
        class="context"
        :class="Token ? 'active1' : 'active'"
      >
        <router-view></router-view>
      </div>
    </div>
  </div>
</template>
<script>
import vHead from "../components/common/Header.vue";
import vSidebar from "../components/common/Sidebar";

export default {
  data() {
    return {
      colla: false,
      Token: true,
    };
  },

  components: { vHead, vSidebar },
  created() {
    this.$get("/Bs/GetUserByToken").then((res) => {
      console.log(res);
      window.localStorage.setItem("hospitalId", res.Data.UserInfo.HospitalId);
      window.localStorage.setItem("UserName", res.Data.UserInfo.UserName);
      window.localStorage.setItem("UserId", res.Data.UserInfo.UserId);
      window.localStorage.setItem("SectionId", res.Data.UserInfo.SectionId);
    });
    window.localStorage.setItem("hospitalId2", baseUrl.orgid);

    this.Token = this.$route.query.Token ? false : true;
    var that = this;
    if (this.$route.query.Token) {
      window.sessionStorage.setItem("Token", this.$route.query.Token);
    }
    if (!this.Token || localStorage.getItem("No_token")) {
    } else {
      // 此处如无token强行跳回登录
      this.$router.push("/login");
      this.$notify.error({
        title: "提示",
        message: "无效token！",
      });
    }
  },
  mounted() {},
  methods: {
    setPage() {
      this.colla = !this.colla;
    },
  },
};
</script>
<style lang="scss">
.HIS {
  background: #fff;
}
.active {
  top: 0px !important;
}
.active1 {
  top: 46px !important;
}
.el-menu {
  border-right: none;
}
.menu {
  .custom-tree-node {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 16px;
    padding-right: 8px;
    font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB",
      "Microsoft YaHei", "微软雅黑", Arial, sans-serif, Medium;
  }

  .custom-tree-nodefont {
    font-size: 16px;
    font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB",
      "Microsoft YaHei", "微软雅黑", Arial, sans-serif, Medium;
    /*width: 14rem!important;*/
    padding-left: 0.5rem !important;
    padding-right: 1rem !important;
    margin: 12px !important;
  }

  .el-tree-node.is-current > .el-tree-node__content > .custom-tree-nodefont {
    background-color: #0f74cc !important;
  }

  .el-tree-node.is-current > .el-tree-node__content {
    background-color: #0f74cc !important;
  }

  .el-tree-node__content:hover {
    background-color: #202c31 !important;
  }

  .el-tree-node__content {
    height: 38px !important;
  }
  .el-menu-item-group__title {
    display: none;
  }
}
.bottom {
  width: 100%;
  display: flex;
  justify-content: space-around;
  .pucMenu {
    position: fixed;
    top: 46px;
    left: 0;
    bottom: 0;
    // padding-top: 8px;
    z-index: 2;
    background: #fff;
    width: 200px;
    overflow-y: auto;

    .el-tree {
      background: transparent;
      color: #ccc;
    }
  }

  .pucMenu::-webkit-scrollbar,
  .pucMenu::-moz-scrollbar {
    display: none;
  }

  .pucMenu dl {
    color: #fff;
    margin: 0;
    cursor: pointer;
    margin-bottom: 1px;
  }

  .pucMenu dl dt {
    line-height: 36px;
    padding-left: 5px;
    color: #ddd;
    background: #494f5a;
  }

  .pucMenu dl dt b {
    font-size: 18px;
    float: right;
    line-height: 36px;
    padding-right: 10px;
  }

  .pucMenu dl .high {
    background: #ecf4ff !important;
    color: #333;
  }

  .lefthidden {
    display: none;
  }

  .pucMenu dl .force {
    background: #494f5a !important;
    color: #ddd !important;
  }

  .pucMenu dl i {
    font-size: 16px;
    margin: 0 11px 0 1px;
    display: inline-block;
    width: 13px;
  }

  .pucMenu dl dd:hover {
    background: #3a5876;
  }

  .pucMenu dl dd {
    line-height: 32px;
    padding-left: 15px;
    color: #ddd;
    display: none;
  }

  .pucMenu dl:first-child dd {
    display: block;
  }

  .IfGuahao {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
    border: none;
    padding-left: 170px;
  }

  .context {
    position: fixed;
    right: 0;
    top: 46px;
    bottom: 0;
    z-index: 99;
    overflow-y: auto;
    background-color: rgb(222, 234, 242) !important;
  }
}
.arrowright {
  left: 180px;
  z-index: 100;
  position: fixed;
  top: 50%;
  width: 20px;
  height: 34px;
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
  background: #d0ebff;
  margin-top: -20px;
  cursor: pointer;
  font-family: cursive;
  font-weight: bold;
  padding: 8px 5px;
  box-shadow: 1px 1px 5px #abb4bb;
}
.arrowleft {
  line-height: 34px;
  left: 3px;
  z-index: 100;
  position: fixed;
  top: 47.5%;
  height: 34px;
  width: 20px;
  padding-left: 3px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
  background: #5b6779;
  color: #fff;
}
ul,
li {
  list-style: none;
}
::v-deep .el-textarea.is-disabled .el-textarea__inner {
  color: #000 !important;
}
</style>
